{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Introducing Indentation"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### CODE - 1"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#include <iostream>\n",
    "\n",
    "using namespace std;\n",
    "\n",
    "int main(){\n",
    "    int a = 10;\n",
    "    int b = 20\n",
    "    if(a == b){\n",
    "    cout<<\"a and b are equal\"<<endl;\n",
    "}\n",
    "    \n",
    "return 0;}"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### CODE - 2"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#include <iostream>\n",
    "\n",
    "using namespace std;\n",
    "\n",
    "int main(){\n",
    "    \n",
    "    int a = 10;\n",
    "    int b = 20\n",
    "    \n",
    "    if(a == b){\n",
    "        cout<<\"a and b are equal\"<<endl;\n",
    "    }\n",
    "    \n",
    "    return 0;\n",
    "}"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "![title](0.jpeg)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## if Statement"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<img src = '1.jpg'>"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-08-21T08:16:07.671991Z",
     "start_time": "2018-08-21T08:16:07.666968Z"
    }
   },
   "outputs": [],
   "source": [
    "# num = True\n",
    "\n",
    "# if(num):\n",
    "#     print('Number is positive')\n",
    "\n",
    "# print('This line will print always')\n",
    "\n",
    "# # if -1 and 0:\n",
    "# # 0, None, -ve, +ve"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## if.....else Statement"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<img src = '2.jpg'>"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-08-21T08:18:21.298954Z",
     "start_time": "2018-08-21T08:18:21.292898Z"
    }
   },
   "outputs": [],
   "source": [
    "# num = -1\n",
    "\n",
    "# if(num >= 0):\n",
    "#     print('Positive')\n",
    "# else:\n",
    "#     print('Negative')\n",
    "# print('This line will print anyways')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## if......elif......else Statement"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<img src = '3.jpg'>"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-08-21T08:21:16.858399Z",
     "start_time": "2018-08-21T08:21:16.851413Z"
    },
    "scrolled": true
   },
   "outputs": [],
   "source": [
    "# num = 0\n",
    "\n",
    "# if(num > 0):\n",
    "#     print('Positive')\n",
    "# elif(num == 0):\n",
    "#     print('ZERO')\n",
    "# else:\n",
    "#     print('Negative')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-08-21T08:23:53.893361Z",
     "start_time": "2018-08-21T08:23:53.886972Z"
    }
   },
   "outputs": [],
   "source": [
    "# # Try 90, 78, 50, 9999\n",
    "\n",
    "# grade = 90\n",
    "\n",
    "# if grade >= 90 and grade<=100:\n",
    "#     print(\"A grade\")\n",
    "\n",
    "# elif grade >=80 and grade<=90:\n",
    "#     print(\"B grade\")\n",
    "\n",
    "# elif grade >=70:\n",
    "#     print(\"C grade\")\n",
    "\n",
    "# elif grade >= 65:\n",
    "#     print(\"D grade\")\n",
    "\n",
    "# else:\n",
    "#     print(\"Failing grade\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Nested if - else Statements"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-08-21T08:26:29.262332Z",
     "start_time": "2018-08-21T08:26:29.255969Z"
    }
   },
   "outputs": [],
   "source": [
    "# num = 0\n",
    "\n",
    "# if num >= 0:\n",
    "#     if num == 0:\n",
    "#         print('Zero')\n",
    "#     else:\n",
    "#         print('Positive')\n",
    "# else:\n",
    "#     print('Negative')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-08-21T08:29:22.289092Z",
     "start_time": "2018-08-21T08:29:22.277129Z"
    },
    "scrolled": true
   },
   "outputs": [],
   "source": [
    "# grade = 60\n",
    "\n",
    "# if grade >= 65 and grade<=100:\n",
    "#     print(\"Passing grade of:\", end = ' ')\n",
    "\n",
    "#     if grade >= 90:\n",
    "#         print(\"A\")\n",
    "\n",
    "#     elif grade >=80:\n",
    "#         print(\"B\")\n",
    "\n",
    "#     elif grade >=70:\n",
    "#         print(\"C\")\n",
    "\n",
    "#     elif grade >= 65:\n",
    "#         print(\"D\")\n",
    "\n",
    "# elif grade>100:\n",
    "#     print('Invalid Input')\n",
    "        \n",
    "# else:\n",
    "#     print(\"Failing grade\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.6"
  },
  "toc": {
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  },
  "varInspector": {
   "cols": {
    "lenName": 16,
    "lenType": 16,
    "lenVar": 40
   },
   "kernels_config": {
    "python": {
     "delete_cmd_postfix": "",
     "delete_cmd_prefix": "del ",
     "library": "var_list.py",
     "varRefreshCmd": "print(var_dic_list())"
    },
    "r": {
     "delete_cmd_postfix": ") ",
     "delete_cmd_prefix": "rm(",
     "library": "var_list.r",
     "varRefreshCmd": "cat(var_dic_list()) "
    }
   },
   "types_to_exclude": [
    "module",
    "function",
    "builtin_function_or_method",
    "instance",
    "_Feature"
   ],
   "window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
